//
//  MyLoginViewController.m
//  bh
//
//  Created by lanou on 15/12/24.
//  Copyright © 2015年 lanou. All rights reserved.
//

#import "MyLoginViewController.h"

@interface MyLoginViewController ()<UITextFieldDelegate>



@end

@implementation MyLoginViewController

- (BOOL)textFieldShouldReturn:(UITextField *)textField {
    [textField resignFirstResponder];
    return YES;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    
    self.navigationController.navigationBarHidden = YES;
    
    
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(kWidth / 5 - 15, kHeight / 6, kWidth / 4 - 10, 20)];
    label.text = @"请先登录";
    
    [self.view addSubview:label];

    UITextField *textField1 = [[UITextField alloc] initWithFrame:CGRectMake(kWidth / 5 - 15, kHeight / 6 + 30, kWidth / 3 * 2, 40)];
    textField1.backgroundColor = [UIColor grayColor];
    textField1.alpha = 0.5;
    textField1.borderStyle = UITextBorderStyleRoundedRect;
    textField1.placeholder = @"邮箱/手机号";
    textField1.delegate = self;

    UITextField *textField2 = [[UITextField alloc] initWithFrame:CGRectMake(kWidth / 5 - 15, kHeight / 6 + 90, kWidth / 3 * 2, 40)];
    textField2.backgroundColor = [UIColor grayColor];
    textField2.borderStyle = UITextBorderStyleRoundedRect;
    textField2.alpha = 0.5;
    textField2.placeholder = @"登录密码";
    textField2.delegate = self;
    
    [self.view addSubview:textField1];
    [self.view addSubview:textField2];
    
    UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(kWidth / 5 - 15, kHeight / 6 + 140, kWidth / 5 , 20)];
    label1.text = @"用户条款";
    label1.font = [UIFont systemFontOfSize:14];
    [self.view addSubview:label1];
    
    UILabel *label2 = [[UILabel alloc] initWithFrame:CGRectMake(kWidth / 5 * 4 - 50, kHeight / 6 + 140, kWidth / 5 , 20)];
    label2.text = @"找回密码";
    label2.font = [UIFont systemFontOfSize:14];
    [self.view addSubview:label2];
    
    
    UIButton *loginButton = [[UIButton alloc] initWithFrame:CGRectMake(kWidth / 5 - 15, kHeight / 6 + 170, kWidth / 3 * 2, 50)];
    loginButton.backgroundColor = [UIColor orangeColor];
    [loginButton setTitle:@"登录" forState:(UIControlStateNormal)];
    
    [loginButton addTarget:self action:@selector(Login) forControlEvents:(UIControlEventTouchUpInside)];
    
    [self.view addSubview:loginButton];
    
    UILabel *lineLabel1 = [[UILabel alloc] initWithFrame:CGRectMake(kWidth / 5 - 15, kHeight / 5 * 3, kWidth / 5 - 20, 1)];
    lineLabel1.backgroundColor = [UIColor grayColor];
    [self.view addSubview:lineLabel1];
    
    UILabel *label3 = [[UILabel alloc] initWithFrame:CGRectMake(kWidth / 5 - 15 + kWidth / 5 - 20 + 10, kHeight / 5 * 3 - 5, kWidth / 3 + 10, 10)];
    label3.text = @"或使用以下账号登录";
    label3.font = [UIFont systemFontOfSize:13];
    [self.view addSubview:label3];
    
    UILabel *lineLabel2 = [[UILabel alloc] initWithFrame:CGRectMake(kWidth / 5 * 4 - 40, kHeight / 5 * 3, kWidth / 5 - 20, 1)];
    lineLabel2.backgroundColor = [UIColor grayColor];
    [self.view addSubview:lineLabel2];
    
    
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(kWidth / 2 - 40, kHeight / 5 * 3 + 20, 80, 80)];
    imageView.image = [UIImage imageNamed:@"sina登录Ver2@2x"];
    imageView.layer.masksToBounds = YES;
    imageView.layer.cornerRadius = imageView.bounds.size.height / 2;
    
    
    [self.view addSubview:imageView];
    
    
    UIButton *phoneButton = [[UIButton alloc] initWithFrame:CGRectMake(kWidth / 5 - 15, kHeight / 5 * 3 + 120, kWidth / 3 * 2, 50)];
    phoneButton.backgroundColor = [UIColor yellowColor];
    
    [phoneButton setTitle:@"手机号快速注册" forState:(UIControlStateNormal)];
    [phoneButton setTitleColor:[UIColor orangeColor] forState:(UIControlStateNormal)];
    [self.view addSubview:phoneButton];
    
    
    

    
    
    
    
}


- (void)Login {
    
    MyTableViewController *myTVC = [[MyTableViewController alloc] init];
    
    
//    [self.view removeFromSuperview];
//    [self.view.superview addSubview:myTVC.view];
//    [self addChildViewController:myTVC];
    
    [self.navigationController pushViewController:myTVC animated:YES];
    

   
//   [self.navigationController pushViewController:myTVC animated:YES];
    
}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
